/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-core
 * Filename：	SPasswordInfoConverter.java
 * Created：		2016年7月30日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.user.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.user.APasswordInfo;
import com.thor.palmmall.spi.user.SPasswordInfo;

/**
 * @author wolv
 *
 */
public class SPasswordInfoConverter implements Converter<APasswordInfo, SPasswordInfo> {

	public static SPasswordInfoConverter getInstance() {
		if (instance == null)
			instance = new SPasswordInfoConverter();
		return instance;
	}

	private static SPasswordInfoConverter instance;

	private SPasswordInfoConverter() {
	}

	@Override
	public SPasswordInfo convert(APasswordInfo source) {
		if (source == null)
			return null;

		SPasswordInfo target = new SPasswordInfo();
		target.setNewPassword(source.getNewPassword());
		target.setOldPassword(source.getOldPassword());

		return target;
	}

}
